import { createRouter, createWebHashHistory } from 'vue-router'
import login from '@/views/Login/index.vue'
import layout from '@/views/Layout/index.vue'

//配置路由地址和路由组件对应关系
const routes = [
    {
        path: '/login',
        component: login,
    },
    {
        path: '/',
        component: layout,
        name: '首页',
        redirect: '/home',
        children: [
            // {
            //     path: '/home',
            //     name: '首页',
            //     component: () => import('@/views/Home/index.vue')
            // },
        ]
    },
    {
        hide: true,
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/Exception/404.vue')
    }
]

//创建路由实列 导入配置项
const router = createRouter({
    routes,
    history: createWebHashHistory()
})


//导出路由实列
export default router